package com.threeonemeeting.list;

import java.util.ArrayList;

import android.view.View;

import com.threeonemeeting.model.BannerAdvInfo;

public class BannerAdvInfoList {

	private ArrayList<BannerAdvInfo> mBannerList = new ArrayList<BannerAdvInfo>();

	public void addBannerAdvInfo(BannerAdvInfo info) {
		if (info == null)
			return;

		mBannerList.add(info);
	}

	public int size() {
		return mBannerList.size();
	}

	public BannerAdvInfo get(int nLocation) {
		return mBannerList.get(nLocation);
	}

	public void clear() {
		mBannerList.clear();
	}

	public BannerAdvInfo getBannerInfo(View v) {
		for (int i = 0; i < mBannerList.size(); i++) {
			BannerAdvInfo info = mBannerList.get(i);
			if (info == null)
				continue;

			if (info.flippingView == v)
				return info;
		}

		return null;
	}
}
